<link rel="stylesheet" href="<?php echo TEMPLATE_SITE_PATH; ?>css/datepicker.css" />
<script src="<?php echo TEMPLATE_SITE_PATH; ?>js/date-time/bootstrap-datepicker.min.js"></script>

<?php echo form_open_multipart('', 'class="form-horizontal" role="form"');?>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Title <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_input('title', set_value('title', $row[field('title')]), 'autocomplete="off" class="col-xs-10 col-sm-5"'); ?>
      <?php echo form_error('title', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Price <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_input('price', set_value('price', $row[field('price')]), 'autocomplete="off" class="col-xs-10 col-sm-5"'); ?>
      <?php echo form_error('price', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Category <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_dropdown('categoryId', $category, set_value('categoryId', $row[field('categoryId')]), 'class="col-xs-10 col-sm-5"'); ?>
      <?php echo form_error('categoryId', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Type <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_dropdown('typeId', $type, set_value('typeId', $row[field('typeId')]), 'class="col-xs-10 col-sm-5"'); ?>
      <?php echo form_error('typeId', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Location <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_dropdown('locationId', $location, set_value('locationId', $row[field('locationId')]), 'class="col-xs-10 col-sm-5"'); ?>
      <?php echo form_error('locationId', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
      <label class="col-sm-3 control-label no-padding-right">Publish Date <span class="red"> *</span></label>
      <div class="col-sm-9">
          <?php echo form_input('publishDate', set_value('publishDate', dateFormat($row[field('publishedAt')], 'd-m-Y')), 'autocomplete="off" class="col-xs-10 col-sm-5 date-picker" data-date-format="dd-mm-yyyy"'); ?>
          <?php echo form_error('publishDate', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
      </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Short Description <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_textarea('shortDescription', set_value('shortDescription', $row[field('shortDescription')]), 'autocomplete="off" class="col-xs-10 col-sm-9"'); ?>
      <?php echo form_error('shortDescription', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Description <span class="red"> *</span></label>
    <div class="col-sm-9">
      <?php echo form_textarea('description', set_value('description', $row[field('description')]), 'autocomplete="off" class="col-xs-10 col-sm-9"'); ?>
      <?php echo form_error('description', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
    </div>
  </div>
  <div class="space-4"></div>
  <div class="form-group">
      <label class="col-sm-3 control-label no-padding-right">Disable</label>
      <div class="col-sm-9">
          <label>
              <input name="disable" class="ace ace-switch" type="checkbox" />
            <?php echo form_checkbox('disable', '1', set_value('disable', $row[field('isDisable')]), 'class="ace ace-switch"'); ?>
              <span class="lbl"></span>
          </label>
        <?php echo form_error('disable', '<div class="col-sm-12 no-padding red">', '</div>'); ?>
      </div>
  </div>
  <?php for($i = 1; $i <= MAX_ADS_IMAGE_UPLOAD; $i++): ?>
  <div class="space-4"></div>
  <div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">Image <?php echo $i; ?></label>
    <div class="col-sm-9">
      <div class="ace-file-input<?php echo $i; ?> col-xs-10 col-sm-5 no-padding">
        <?php echo form_upload('image[]', '', 'id="input-file-image'.$i.'"'); ?>
      </div>
    </div>
  </div>
  <?php endfor; ?>
  <div class="clearfix form-actions">
    <div class="col-md-offset-3 col-md-9">
      <?php echo anchor(site_url(module_controller('view')),'&larr; Cancel', 'class="btn"');?>
      <button name="btnSave" class="btn btn-info" type="submit">
        <i class="icon-ok bigger-110"></i>Save
      </button>
    </div>
  </div>
<?php echo form_close();?>
